import QtQuick 2.15
import QtQuick.Controls 2.1

AbstractButton {
    id: control
    property string normalimage: ""
    property string hotimage: ""
    property string pushedimage:""
    implicitWidth: control.width
    implicitHeight: control.height
    contentItem: Text {
        text: control.text
        font: control.font
        opacity: enabled ? 1.0 : 0.3
        color:"#ffffff"
        horizontalAlignment: Text.AlignHCenter
        verticalAlignment: Text.AlignVCenter
        //elide: Text.ElideRight
    }

    background: Item {
    }

    indicator: Rectangle {
        implicitWidth: control.width
        implicitHeight: control.height

        //opacity: enabled ? 1 : 0.3
        //border.color: control.down ? "#17a81a" : "#21be2b"
        //border.width: 1
        //radius: 6
        color: "transparent"
        Image
        {
            width: control.width
            height: control.height
            anchors.fill: parent
            source:
            {
                if(control.pressed)
                {
                    pushedimage
                }else if(control.hovered)
                {
                    hotimage
                }
                else
                {
                    normalimage
                }
            }

        }
    }

}
